package com.ruoyi.experiment.mapper;

import com.ruoyi.experiment.domain.*;
import com.ruoyi.experiment.model.EProject;
import com.ruoyi.experiment.model.ESample;
import com.ruoyi.experiment.model.SampleFlume;
import com.ruoyi.experiment.model.TreeSample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface ExperimentOutMapper {
    List<EProject> selectAllItem(Project project);

    List<Sample> selectSamples(Sample sample);

    boolean updateSample(Sample sample);

    /**
     * 流转
     * @param id
     * @param expermentType
     * @return
     */
    boolean flumeExperiment(@Param("id") Long id,@Param("expermentType") Integer expermentType);

    boolean insertFlume(Circulation circulation);

    /**
     * 查询实验管理
     *
     * @param experimentId 实验管理主键
     * @return 实验管理
     */
    Experiment selectExperimentalManagementByExperimentId(Long experimentId);

    /**
     * 查询实验管理列表
     *
     * @param experimentalManagement 实验管理
     * @return 实验管理集合
     */
    List<Experiment> selectExperimentalManagementList(Experiment experimentalManagement);


    /**
     * 修改实验管理
     *
     * @param experimentalManagement 实验管理
     * @return 结果
     */
    int updateExperimentalManagement(Experiment experimentalManagement);

    void cancelPost(Experiment experiment);

    List<Job> selectJobByExperimentType(Integer type);

    int insertCirculation(SampleFlume sampleFlume);

    void updateProject(Long id);

    Experiment selectExperimentBySampleId(Long id);

    List<ESample> selectSamplesWithExperiment(Sample sample);

    void endOutExperiment(@Param("id")Long id,@Param("order")Integer order);
    void finishOutExperiment(Long id);
    List<TreeSample> selectTreeSamples(@Param("parentId") Long parentId);
    List<TreeSample> selectRootSamples(Long projectId);
    void insertSample(Sample sample);

    List<Long> selectSampleIdByParentId(List<Long> ids);

    void backSamples(List<Long> ids);

    /**
     * 将已制备的样品状态从6改为7
     * @param id
     */
    Integer updateMakedSample(Long id);

    /**
     * 根据实验id查询岗位类型
     * @return
     */
    Integer selectJobTypeByjobId(Long id);

}
